﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ACPanel/AdminPage.master" AutoEventWireup="true"
    CodeFile="AddEditPhotos.aspx.cs" Inherits="ACPanel_NodeMedia_AddEditPhotos" %>

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox, Version=3.3.0.22914, Culture=neutral, PublicKeyToken=5962a4e684a48b87" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="<%= Page.ResolveClientUrl("~/css/jquery.tagsinput.css") %>" rel="stylesheet"
        type="text/css" />
    <link href="../../css/site.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        var counter = 0;
        function AddFileUpload() {
            var div = document.createElement('DIV');
            div.innerHTML = '<input class="form-control" id="file' + counter + '" name = "file' + counter + '" type="file" /><input id="Button' + counter + '" type="button" class="btn btn-default" value="Remove" onclick = "RemoveFileUpload(this)" />';
            document.getElementById("FileUploadContainer").appendChild(div);
            counter++;
        }
        function RemoveFileUpload(div) {
            document.getElementById("FileUploadContainer").removeChild(div.parentNode);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="row form-group">
        <div class="col-lg-12">            
            <h1>
                Thêm mới / Chỉnh sửa ảnh</h1>
            <ol class="breadcrumb">
                <li><i class="fa fa-dashboard"></i> Bảng điều khiển</li>
                <li class="active"><i class="fa fa-table"></i> Thêm mới / Chỉnh sửa ảnh</li>
            </ol>
        </div>
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <asp:GridView CssClass="table table-bordered" ID="gv" DataKeyNames="Id" runat="server"
                CellPadding="4" ForeColor="#333333" GridLines="None" PageSize="10" AllowPaging="true"
                PagerSettings-Position="TopAndBottom" OnPageIndexChanging="gv_PageIndexChanging"
                PagerSettings-PageButtonCount="5" AllowSorting="true" OnSorting="gv_Sorting"
                EmptyDataText="Chưa cập nhật dữ liệu" AutoGenerateEditButton="False" AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink2" ToolTip="Xóa" runat="server" NavigateUrl='<%# "~/ACPanel/NodeMedia/DeletePhoto.aspx?" + "Id=" + Eval("Id") %>'><i class="fa fa-eraser"></i></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Id" />
                    <asp:BoundField DataField="IdAlbumAnh" HeaderText="IdAlbumAnh" />
                    <asp:BoundField DataField="TieuDe" HeaderText="TieuDe" />
                    <asp:BoundField DataField="AnhDaiDien" HeaderText="AnhDaiDien" />
                    <asp:BoundField DataField="TomTat" HeaderText="TomTat" />
                    <asp:BoundField DataField="NgayCapNhat" HeaderText="NgayCapNhat" />
                    <asp:CheckBoxField DataField="TrangThai" HeaderText="TrangThai" />
                </Columns>
                <AlternatingRowStyle BackColor="White" />
                <FooterStyle BackColor="#d02027" Font-Bold="True" ForeColor="Black" />
                <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
                <PagerStyle CssClass="phan-trang" BackColor="#428bca" ForeColor="#ffffff" HorizontalAlign="Center" />
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" VerticalAlign="Middle" Wrap="True" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <PagerSettings Mode="NumericFirstLast"></PagerSettings>
            </asp:GridView>
        </div>
        <div class="col-lg-7 col-md-8 col-sm-6 col-xs-12">
            <p>
                <asp:HyperLink ID="HyperLink1" runat="server" CssClass="btn btn-danger" NavigateUrl="~/ACPanel/NodeMedia/QLAlbumAnh.aspx"><i class="fa fa-backward"></i> Trở về</asp:HyperLink>
            </p>
            <label>
                Tiêu đề</label>
            <p>
                <asp:TextBox CssClass="form-control" runat="server" ID="tbTieude" placeholder="Tên chuyên mục con"
                    MaxLength="100"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" SetFocusOnError="True"
                    ControlToValidate="tbTieude" Display="Dynamic" ErrorMessage="(*) Chưa nhập dữ liệu"
                    ValidationGroup="groupAddUpdatePT"></asp:RequiredFieldValidator>
            </p>
            <p>
                <label>
                    Tóm tắt</label>
                <asp:TextBox TextMode="MultiLine" CssClass="form-control" runat="server" ID="tbTags"
                    Placeholder="Tóm tắt" Columns="3"></asp:TextBox>
            </p>
            <p>
                <label>
                    Nội dung</label>
                <FTB:FreeTextBox ID="tbNoidung" AutoParseStyles="True" Width="100%" HtmlModeCssClass="form-control"
                    ImageGalleryPath="~/Upload" ToolbarStyleConfiguration="OfficeXP" UseToolbarBackGroundImage="True"
                    ToolbarBackgroundImage="True" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,
                            FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,Strikethrough,
                            Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,
                            NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage|Cut,Copy,Paste,Delete;Undo,Redo,Print|
                            SymbolsMenu,StylesMenu,InsertHtmlMenu|InsertRule,InsertDate,InsertTime|InsertTable|InsertImageFromGallery,Preview,SelectAll"
                    runat="Server" />
            </p>
            <label>
                Trạng thái</label>
            <p>
                <asp:CheckBox CssClass="form-control" runat="server" ID="cbTrangthai" ToolTip="Hiển thị" />
            </p>
        </div>
        <div class="col-lg-5 col-md-4 col-sm-6 col-xs-12">
            <span style="font-family: Arial">Click vào đây để thêm mới một ảnh : </span>&nbsp;&nbsp;
            <input id="Button1" class="btn btn-success" type="button" value="Thêm mới ảnh" onclick="AddFileUpload()" />
            <br />
            <br />
            <div id="FileUploadContainer">
                <!--FileUpload Controls will be added here -->
            </div>
            <br />
            <asp:LinkButton ID="btnUpload" CssClass="btn btn-success" runat="server" OnClick="btnUpload_Click">
                <i class="fa fa-upload"></i> Tải lên
            </asp:LinkButton>
        </div>
    </div>
</asp:Content>
